<?php

class FormPanel extends FormControl {
	
	public static $property = array(
		'wbtype',
		'name',
		'caption',
		'x',
		'y',
		'width',
		'height',
		'visible',
		'layout'
	);
	
	public function __construct() { 
		parent::__construct(array(
			'wbtype' => 'Panel',
			'x' => 0,
			'y' => 0,
			'width' => 100,
			'height' => 100,
			'layout' => 'grid columns=2 rows=2 hgap=2 vgap=2'
		));
	}

	/**
	 * 컨트롤 그리기 
	 * 
	 * @param WBGraphics $graphics
	 */
	public function displayControl(WBGraphics $g) {

		$xstart = $this->getOption('x');
		$ystart = $this->getOption('y');
		$width = $this->getOption('width');
		$height = $this->getOption('height');		
		$xcenter = $xstart + $width / 2;
		$xend = $xstart + $width;
		$ymiddle = $ystart + $height / 2;
		$yend = $ystart + $height;	
	
		$g->rect($xstart, $ystart, $width, $height, FormControl::SHADE, false, 1, WBGraphics::LINE_DASHES_3);
	}
	
	
	public function getProperty() { 
		return self::$property;
	}	
	
	public function getBounds($param = true) { 
		return array(
			'x' => $this['x']+4,
			'y' => $this['y']+4,
			'width' => $this['width']-8,
			'height' => $this['height']-8,
		);
	}		
}


?>